cmake_minimum_required(VERSION 3.16)
project(IfElse)
add_executable(main main.cpp)

if(ON)
	message("ON")
endif()

if(NOT IGNORE)
	message("NOT IGNORE")
endif()

if(ON AND NO)
	message("ON AND NO")
elseif(OFF OR 0)
	message("OFF OR 0")
else()
	message("else()")
endif()

if(NOT "var")
	message("NOT var")
endif()

set(var1 "var1")
if(var1)
	message("var1")
endif()

function(func1)
	message("func1")
endfunction()

if(COMMAND func1)
	message("COMMAND func1")
endif()

if(NOT COMMAND func2)
	message("NOT COMMAND func2")
endif()

if(POLICY CMP0054)
	message("POLICY CMP0054")
endif()

if(TARGET main)
	message("TARGET main")
endif()

if(NOT TEST test1)
	message("NOT TEST test1")
endif()

if(EXISTS /home/xlll/)
	message("EXISTS")
endif()

if(/home/xlll/CMakeProjs/IfElse/CMakeLists.txt IS_NEWER_THAN /home/xlll/CMakeProjs/IfElse/main.cpp)
	message("IS_NEWER_THAN")
endif()

if(IS_DIRECTORY /home/xlll/CMakeProjs/IfElse/)
	message("IS_DIRECTORY")
endif()

if(NOT IS_SYMLINK /home/xlll/CMakeProjs/IfElse/CMakeLists.txt)
	message("NOT IS_SYMLINK")
endif()

if(IS_ABSOLUTE /home/xlll/)
	message("IS_ABSOLUTE")
endif()

if("a" MATCHES "[abc]")
	message("MATCHES")
endif()

set(var1 5)
set(var2 10)
if(var1 LESS var2)
	message("LESS")
endif()

set(var1 "hello")
set(var2 "world")
if(var1 STRLESS var2)
	message("STRLESS")
endif()

set(var1 "3.16.4")
set(var2 "3.17")
if(var2 VERSION_GREATER var1)
	message("VERSION_GREATER")
endif()

set(var1 "a")
set(var2 a b c d)
if(var1 IN_LIST var2)
	message("IN_LIST")
endif()

if(DEFINED var1)
	message("DEFINED")
endif()

set(varFalse FALSE)
set(varName "varFalse")
if(${varName})
	message("${varName} is true")
else()
	message("${varName} is false")
endif()

if(varName)
	message("varName is true")
endif()
